Page({
  data: {
    isDeleteDialogShowed:false,
    beforeDelete:{},
    tagsHistory:['卫衣','秋裤','亲子套装','iphone16 max','华为','荣耀15','特斯拉手机','情侣装夏季均码'],
    tagsTop:['卫衣','秋裤','亲子套装','iphone16 max','华为','荣耀15','特斯拉手机','情侣装夏季均码'],
  },
  onLoad(){
    this.setData({beforeDelete:(act=>this.beforeDelete(act))});
  },
  search(e) {
    console.log('search e:',e.detail.kw);
    if(!e.detail.kw){
      wx.showToast({
        title: '请填写关键词',
      })
      return;
    }
    wx.navigateTo({
      url: 'list/index?kw='+e.detail.kw,
    });
  },
  toKw(e) {
    //console.log('toKw:',e);
    wx.navigateTo({
      url: 'list/index?kw='+e.target.dataset.kw,
    });
  },
  showDeleteDialog(e){
    this.setData({isDeleteDialogShowed:true});
  },
  beforeDelete(act){
    console.log('deleteHistory:',act);
    if(act=='cancel'){
      this.setData({isDeleteDialogShowed:false});
      return false;
    }else{
      this.setData({tagsHistory:[]});
      this.setData({isDeleteDialogShowed:false});
      return false;
    }
    
  },
  toList(e) {
    console.log('toList:',e);
  }
})